/**连接数据库 */
const mongoose = require('mongoose');

//连接数据库
mongoose.connect('mongodb://localhost:27018/saokui',function(err){
    if(err){
        console.log(连接失败);
        throw err;
    }else{
        console.log('连接成功')
    }
});

//创建Schema表
const userSchema = new mongoose.Schema({
    username:String,
    password:String
});


//等待其他什么鬼数据...
const adminSchema = new mongoose.Schema({
    username:String,
    password:String
});

//生成user的model对象
const User =mongoose.model('user',userSchema);
const Admin =mongoose.model('admin',adminSchema);

module.exports={User,Admin};